<!doctype html>
<html>
		<head>
		<title>消息</title>
		<meta http-equiv="content-type" content="text/html;charset=utf-8">
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta content="telephone=no" name="format-detection" />
		<meta id="vieport" name="viewport" content="width=640, initial-scale=0.5, minimum-scale=0.5, maximum-scale=0.5">
		<script src="js/jquery-1.8.0.min.js"></script>
		<script type="text/javascript" src="js/jquery.getparm.js"></script>
		<script type="text/javascript" src="js/jquery.cookie.js"></script>
		<script type="text/javascript" src="js/common.js"></script>
		<link rel="stylesheet" type="text/css" href="./css/home.css?version=0310" />
		<link rel="stylesheet" type="text/css" href="./css/common.css?version=0310" />
		<link rel="stylesheet" type="text/css" href="common.css">
		<link rel="stylesheet" type="text/css" href="home.css?version=0310">
		<script type="text/javascript" src="js/common.js?version=0310"></script>
		<script language="javascript">
var a = $.cookie("NP_INFO_ID");
var b = $.cookie("U_KEY");
$(function () {
	$.natureajax({
		type : "get",
		url : jsonserver + "msg_getMsgDaysList.do?callback=?", //获取JSON
		data : "MSG_NATURE_FID=" + a + "&pageSize=10&pageNo=1&ukey=" + b,
		dataType : "jsonp",
		success : function (json) {
			var data = json[1].data;
			if (data.length > 0) {
				//有消息进行遍历
				var _html = '';
				for (i = 0; i < data.length; i++) {
					var obj = data[i];
					//根据消息条数进行拼接生成消息框
					_html += '<div id="xiaoxi' + i + '" onclick="clickList(' + i + ',\'' + obj.MSG_TIME + '\');" style="min-midth:640px;margin-left:1%;width:98%;margin-top:7px;padding:0px;">'
					 + '<table class="fangkuang" cellpadding="0" cellspacing="0">'
					 + '<tr class="firstline" >'
					 + '<td style="width:10%;padding-left:1%;"><div class="hongxiaoxi"></div></td>'
					 + '<td ><sapn style="margin-left:10%;">' + obj.MSG_TIME + '&nbsp;消息条数(</sapn><sapn style="color:#A40000">' + obj.EACHDAYCOUNT + '</sapn><sapn>)</sapn></td>'
					 + '</tr><tr><td colspan="2"><div id="liebiao' + i + '" style="display:none"></div></td></tr></table></div>';

				}
				$("#list").append(_html);
			} else {
				$("#list").append("<div style='text-align:center;font-size:30px;'>暂无消息</div>");
			}

		},
		error : function () {
			alert("出错了!");
		}

	})

})

function clickList(index, MSG_TIME) {
	if ("none" != $("#liebiao" + index).css("display")) {
		$("#liebiao" + index).slideToggle(function () {});
		return;
	}
	var a = $.cookie("NP_INFO_ID");
	var b = $.cookie("U_KEY");
	$.natureajax({
		type : "get",
		url : jsonserver + "msg_getMsgDayList.do?callback=?", //获取JSON
		data : "MSG_NATURE_FID=" + a + "&pageSize=100&pageNo=1&ukey=" + b + "&MSG_TIME=" + MSG_TIME,
		dataType : "jsonp",
		success : function (json) {
			var data1 = json[1].data;
			if (data1.length > 0) {
				//有消息进行遍历
				var _html2 = '';
				for (i = 0; i < data1.length; i++) {
					var obj1 = data1[i];
					var c = "#000";
					//根据消息条数进行拼接生成消息框
					if (obj1.MSG_IS_READED == "1") {
						c = "#7D7D7D";
					}
					if (i != data1.length - 1) {
						_html2 += '<table onclick="xiayiji(' + i + ',\'' + obj1.MSG_ID + '\');" width="98%" style="color:' + c + ';"><tr class="secondline" >'
						 + '<td colspan="2"><ul style="list-style-type:none"><li>推荐号：<span style="color:green">' + obj1.MSG_ORDER_NO + "</span>&nbsp;&nbsp;&nbsp;&nbsp;" + obj1.MSG_TYPE_NAME + '</li>'
						 + '<li>客户：' + obj1.CUI_NAME + '</li><li>联系电话：' + obj1.CUI_CONTACTTEL + '</li><li>' + obj1.MSG_TEXT + '</li><li style="color:green;">请注意查收></li></ul>'
						 + '</td><td style="width:10%;"><div style="width:17px;height:26px;background:url(img/jiantou.png) no-repeat;">'
						 + '</div></td></tr></table>'
					} else {
						_html2 += '<table onclick="xiayiji(' + i + ',\'' + obj1.MSG_ID + '\');" width="98%" style="color:' + c + '";><tr  >'
						 + '<td colspan="2"><ul style="list-style-type:none"><li>推荐号：<span style="color:green">' + obj1.MSG_ORDER_NO + "</span>&nbsp;&nbsp;&nbsp;&nbsp;" + obj1.MSG_TYPE_NAME + '</li>'
						 + '<li>客户：' + obj1.CUI_NAME + '</li><li>联系电话：' + obj1.CUI_CONTACTTEL + '</li><li>' + obj1.MSG_TEXT + '</li><li style="color:green;">请注意查收></li></ul>'
						 + '</td><td style="width:10%;"><div style="width:17px;height:26px;background:url(img/jiantou.png) no-repeat;">'
						 + '</div></td></tr></table>'
					}
				}
				$("#liebiao" + index).html(_html2);
				$("#liebiao" + index).slideToggle(function () {});
			} else {

				$("#liebiao" + index).html("<div style='color:red;text-align:center; font-size:30px;'>暂无消息</div>");

			}
		},
		error : function () {
			alert("出错了!");
		}

	})
}
function xiayiji(index, MSG_ID) {
	var url = "./dingdanxq.html";
	url += "?MSG_ID=" + MSG_ID + "&MSG_NATURE_FID=" + a + "&ukey=" + b;
	window.location.href = url;

}
		</script>
		<style>
.fangkuang {
	font-size: 27px;
	color: #7D7D7D;
	bodder: 1px;
	border-style: solid;
	border-radius: 9px;
	margin-left: 1%;
	width: 98%;
	height: 60px;
	border-color: #D3D6D7;
	font-family: '微软雅黑';
}
.firstline {
	background-color: #F2F8F9;
	height: 70px;
}
.firstline td {
	border-bottom: 1px solid #D3D6D7;
}
.secondline td {
	border-bottom: 1px solid #D3D6D7;
}
.hongxiaoxi {
	magrgin-left: 2%;
	width: 40px;
	height: 43px;
	background: url('img/xiaoxi_xx.png')no-repeat;
}
</style>
		</head>
		<body >
        <div id="bodyobj" class="bigimg" style="overflow: hidden;">
          <div id="header" style="width:100%">
            <div id="header" style="text-align:center;" class="header">
              <table width="100%" class="headerTal">
                <tr>
                  <td class="menuTd" id="menuBtn" onClick="window.history.go(-1);">返回</td>
                  <td style=" text-align:center;font-size:32px; color:#fff;">我的消息</td>
                  <td width="18%"></td>
                </tr>
              </table>
            </div>
            <div id="home1" style="width:100%;overflow: auto;"> 
              <!--页面主体开始-->
              <div id="list" style="margin-left:1%;width:98%;min-width:640px;" > </div>
              <!--页面主体结束--> 
            </div>
          </div>
        </div>
</body>
</html>